UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3wcynBruPoeoCtO7o/KLGySiVDVimS2W9wbharKNXv4='
WHERE
key_id = 'd2b2391a7ab3b4fba1548ea350e209cfd70565199e6ee109e745ea6f603a1e10'
AND (
token = '3wcynBruPoeoCtO7o/KLGySiVDVimS2W9wbharKNXv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)