UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QCgZ0Ime3UPKFG/h8xKpaeGSNFIiAMgnAbgRnbC1Xno='
WHERE
key_id = '27fa4ed9b268f35aa01e7ca3f7d322096ab1d8795983b0a3f751c8dd6805d58e'
AND (
token = 'QCgZ0Ime3UPKFG/h8xKpaeGSNFIiAMgnAbgRnbC1Xno='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)