UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QaSvVmo0YbUyk4pseND2Uq+cGR2oFaAzVCoSPo6SYSQ='
WHERE
key_id = 'b1cb725d4fe4aa1d3032aa7efe1de8eb78bdcc7304849a6feb39ef1e93cc73d3'
AND (
token = 'QaSvVmo0YbUyk4pseND2Uq+cGR2oFaAzVCoSPo6SYSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)