UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9OuzFZJen07f7x/ri2vlTG/EoUNMlDPfTOCzj0zan5Y='
WHERE
key_id = 'a2e67351cf3d51887946a488d1e4a8bc59d35e1c3ac86684df51fe61abe21dd8'
AND (
token = '9OuzFZJen07f7x/ri2vlTG/EoUNMlDPfTOCzj0zan5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)