UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TzDeTHU9abRM2GHi8IUnHyDwpGRIyyvCdJhXpBOKaYQ='
WHERE
key_id = '6e0575ae4d28170d45326a02fc7d560d65baff197ce5f366eb22758397bac6ae'
AND (
token = 'TzDeTHU9abRM2GHi8IUnHyDwpGRIyyvCdJhXpBOKaYQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)