UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'myFV+VnQjSPneMFZpD71b1IC61espy2KUl2bU0bsy9U='
WHERE
key_id = 'fb8cb7d347adf05faafd0c2c449513a13d0e7eb12218bcaab13325d993e36122'
AND (
token = 'myFV+VnQjSPneMFZpD71b1IC61espy2KUl2bU0bsy9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)