UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VHQIZEg6krPLgEbUr7UYj6IehvgNgyHQAdGqRGuwTVU='
WHERE
key_id = '78fba655e2bd545e007c11d95bd630515d27c08bb1bfd3d003c1882ae274ff15'
AND (
token = 'VHQIZEg6krPLgEbUr7UYj6IehvgNgyHQAdGqRGuwTVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)