UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R7l4Jy3XXkAGgB/NAiiPYRR+dMw29FiiYjOs1PnNn3M='
WHERE
key_id = '0a2b5a308fe12e3eedd9f1a7ae5953e3f7faabb74999603a544c329fb430f7bd'
AND (
token = 'R7l4Jy3XXkAGgB/NAiiPYRR+dMw29FiiYjOs1PnNn3M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)