UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yj2TC4p3j+s+qpnu/EqOG7vQt215Icbznf0ig8e+ip8='
WHERE
key_id = '26722f349321d50e0f2d9e7181e484d4d367c659e7744d405d7475d16dc7ba78'
AND (
token = 'yj2TC4p3j+s+qpnu/EqOG7vQt215Icbznf0ig8e+ip8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)