UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g5X+W9FBqsNrYgYtNdlQ0Suoks33Khk0bpQ2qlfJwc4='
WHERE
key_id = 'b2e0e0fa89ba360fb5c20933c4d8dc84e14b406e23bac6140032c5560142e456'
AND (
token = 'g5X+W9FBqsNrYgYtNdlQ0Suoks33Khk0bpQ2qlfJwc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)