UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sTjtRTceU9OUsvdhwBpIcmkq6Fyn1KaQhooteMaptt0='
WHERE
key_id = '0b93f5a2daffd946cb7da11be837406725997c6ded659ac6900334ce3c928596'
AND (
token = 'sTjtRTceU9OUsvdhwBpIcmkq6Fyn1KaQhooteMaptt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)