UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6zY/7+apCe99j0dpQSEKUUhM+AB5aX78dUq1efy4A40='
WHERE
key_id = '888a5561f38870cd0c413602c63dfda3e71b0f588a12101dbca7986a4b1a1b77'
AND (
token = '6zY/7+apCe99j0dpQSEKUUhM+AB5aX78dUq1efy4A40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)