UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E/963cTyghE+biRQkm+vG6C64Qb9BR2oFx/0qbwfYTk=' 
WHERE 
  key_id = 'd586fc4ae373854b13beb9d7caa1277e51003979f189d83557932016bb825fb8' 
  AND (
    token = 'E/963cTyghE+biRQkm+vG6C64Qb9BR2oFx/0qbwfYTk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036