UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uYcguC7wwZDb0v1ToG8Go1Xdjhdffx2A1/7MfXMqtVY='
WHERE
key_id = 'cfb5ce9df86c0ace6d801141fb0948e676fea9eddab964096cee459671441566'
AND (
token = 'uYcguC7wwZDb0v1ToG8Go1Xdjhdffx2A1/7MfXMqtVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)