UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jU5xRmmGp7jRqnhzvncG0sd+xQacAEbp7bMijRHjt30='
WHERE
key_id = '4d01d6c6638cb9dac567b1c89c8ccf05687eaa86201b9cba1a1f1c227432f84f'
AND (
token = 'jU5xRmmGp7jRqnhzvncG0sd+xQacAEbp7bMijRHjt30='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)