UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'If/36XJp0GeFRxZChWwbOwL6lil2ZQyASt7Dzzf37Q4=' 
WHERE 
  key_id = 'f2f230820d2a73ec9c6b6c05ccf9ec986a8baf548661853ed302ae2aea48ff62' 
  AND (
    token = 'If/36XJp0GeFRxZChWwbOwL6lil2ZQyASt7Dzzf37Q4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032