UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DhiPZRIbuOOZIPZgxWmvL73pUyFpG2092j1DEq4PwsM=' 
WHERE 
  key_id = '5a71f672b8bf67dfb9ebd2bef3158e0635408acd93c152d3cfdda8fefe8e4824' 
  AND (
    token = 'DhiPZRIbuOOZIPZgxWmvL73pUyFpG2092j1DEq4PwsM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026