UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U/y8bYW3pGLZBHOJXZxjlAxSitOnbUAKrnvC/T1UKwI='
WHERE
key_id = 'a3a1a7f2e66e788dcb71e5ee06398b401c73a50f2abbd458603ed6c7db1bb2f2'
AND (
token = 'U/y8bYW3pGLZBHOJXZxjlAxSitOnbUAKrnvC/T1UKwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)