UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IguQSn4CtdcXhbyFD2IMCwL/VxhddL2afi0LMdlh0d8='
WHERE
key_id = 'd26b17ff79a817e62f3d6fe8cdb579e5c27c46863a7ba05769f8a5f7e7489c10'
AND (
token = 'IguQSn4CtdcXhbyFD2IMCwL/VxhddL2afi0LMdlh0d8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)