UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F0z/UOi1H82+8r+EJijGL7rl8i5tnv3EnMyf3GNFe+A='
WHERE
key_id = 'c879dd90dccefaf82bf9578311543cf3c724a137045a7dbd4860c909842f5dcb'
AND (
token = 'F0z/UOi1H82+8r+EJijGL7rl8i5tnv3EnMyf3GNFe+A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)