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