UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XRhoH2EJHwqClyu/qtoeL5qyi2KRmeEsnXbLQg67Px4='
WHERE
key_id = 'd152825bbf618534ec3346e336b5ce2fd82d5aeb109c773bfc2a387faa906e94'
AND (
token = 'XRhoH2EJHwqClyu/qtoeL5qyi2KRmeEsnXbLQg67Px4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)