UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Osxe+AKRumu7MoA8MwOGL8YVi0Y9WqspLyXPSYsoxQI='
WHERE
key_id = '1a6be47547ecabc4704851af3dfc075eff4e5b7766981c115366e79859ad0ff2'
AND (
token = 'Osxe+AKRumu7MoA8MwOGL8YVi0Y9WqspLyXPSYsoxQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)