UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aSeAAyd0MPpS6N1g9xn4+SY8JPU75tSSZEChlP39laE=' 
WHERE 
  key_id = 'f55ff1bdb55485bdc7822d0372643ec63a8560e5a4859860dfeffab5724b3d61' 
  AND (
    token = 'aSeAAyd0MPpS6N1g9xn4+SY8JPU75tSSZEChlP39laE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029