UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XOOERUcay+spMs5WVa0SBGIVgfBP8Wqn5N0p4/IpvO0='
WHERE
key_id = 'ffb68dea95081bc1a8105c06452548c352b22824a543973f245cb67f51a43aaa'
AND (
token = 'XOOERUcay+spMs5WVa0SBGIVgfBP8Wqn5N0p4/IpvO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)