UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YU/HpVQ4ZpDdX10iKZTy3aPpeoGpBroLEN2l+3vgHPc='
WHERE
key_id = 'f8f2a2f33ac9f740d01025ebab74d659bcc77350d6b0a9436f0f557228aa736e'
AND (
token = 'YU/HpVQ4ZpDdX10iKZTy3aPpeoGpBroLEN2l+3vgHPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)