UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F/GQsHzR+6CpyL5ZPCzXvVHEmNDIs0CjgZ3fZSaueR0=' 
WHERE 
  key_id = '1659e23d180afd12858bbcce31f90fb1e64c0b8c7728d2fb3009f586cd7fff91' 
  AND (
    token = 'F/GQsHzR+6CpyL5ZPCzXvVHEmNDIs0CjgZ3fZSaueR0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030