UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WRs2Qp+wJYTdOD3fCWxNUlymroINV2NuKYO/BJburAg=' 
WHERE 
  key_id = 'a4fb9a4372e75b7664da8048d6e9c2ff18603a85eec33aa1b059591b67a5cc8a' 
  AND (
    token = 'WRs2Qp+wJYTdOD3fCWxNUlymroINV2NuKYO/BJburAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024