UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hcmZu5KwyXwXQPORIKB0WaJk2SA2YBKzmE45VKRGpcY='
WHERE
key_id = 'a6e4923b9d73ccf93cfdb91ddc643dc48ad36317dccf2346a81939257bd8a4e9'
AND (
token = 'hcmZu5KwyXwXQPORIKB0WaJk2SA2YBKzmE45VKRGpcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)