UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5QGJWLuzLEOiDsv/LvyLU3zeIA21jrcb5AXGrNaEE3o=' 
WHERE 
  key_id = 'be7b7dc5fba979de6f6e02e4b2ba617479667aa36076de2ff458524f4c241c59' 
  AND (
    token = '5QGJWLuzLEOiDsv/LvyLU3zeIA21jrcb5AXGrNaEE3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018