UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/PuDhWfcDvM8zyXlb6wEAJcBHP/U+FHTTVM8YeZpJXM='
WHERE
key_id = '02a6b49be9c368e11081f3d89f2963ba4927dcfb6887e029123bdb8c3b7fa8d4'
AND (
token = '/PuDhWfcDvM8zyXlb6wEAJcBHP/U+FHTTVM8YeZpJXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)